<!DOCTYPE html>
<html>
<head>
    <title>学生管理</title>
    <style>
        h1 {
            color: yellow;
        }
        body {
            height: 100%;
            background-image: linear-gradient(to right, #4CAF50, #008CBA);
            color: white;
            font-family: Arial, sans-serif;
            text-align: center;
        }
        table {
            margin: 0 auto;
            border-collapse: collapse;
            width: 60%;
        }
        th, td {
            border: 1px solid black;
            padding: 15px;
            text-align: center;
        }
        a {
            color: yellow;
            display: block;
            margin: 10px 0;
            text-decoration: none; /* 移除链接下划线 */
        }
        button {
            background-color: #3196b8;
            color: white;
            border: none;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <h1>学生管理界面</h1>
    <table>
        <thead>
            <tr>
                <th>序列</th>
                <th>学号</th>
                <th>名字</th>
                <th>性别</th>
                <th>年龄</th>
                <th>班级</th>
                <th>家庭住址</th>
                <th>删除操作</th>
                <th>修改操作</th>
            </tr>
        </thead>
        <tbody>
            {{range $index, $value := .student_slice}}
            <form name="index" action="/id_delete" method="post">
            <tr>
                <td>{{$index}}</td>
                <td>{{$value.Id}}</td>
                <td>{{$value.Name}}</td>
                <td>{{$value.Sex}}</td>
                <td>{{$value.Age}}</td>
                <td>{{$value.Class}}</td>
                <td>{{$value.Address}}</td>
                <td><button name="student_id" value="{{$value.Id}}" type="submit">删除</button></td>
                <td><a name="id" href="/display_one_student/{{$value.Id}}" value="{{$value.Id}}" type="submit" method="post">修改</a></td>
            {{end}}
            </form>
        </tbody>
    </table>
    <a href="/add">添加学生</a>
    <a href="/jc">查看成绩</a>
    <a href="/class">查看教室信息</a>
    <a href="/teacher">查看教师信息</a>
</body>
</html>